const obj = {
  getName: '黑马',
  getAge: 33
}
function getData(obj) {
  const temObj = {}
  for (const [key, value] of Object.entries(obj)) {
    temObj[key.replace(/[A-Z]/g, (match) => `_${match.toLowerCase()}`)] = value
  }
  return temObj
}
console.log(getData(obj))

